{include file="file:$theme_global/_header.tpl"}	
{include file="file:$theme_global/_user_image.tpl"}
<div id="main">
	<div class="main">
		<div class="sec">
			<div class="title"><h1>{$pagetitle}</h1></div>
			<div class="inner">
				{if $isLoggedIn}
					{include file="file:$theme_global/_messages.tpl"}			
					<form method="post" enctype="multipart/form-data" action="/user/addcomment/username/{$user.username}">	
						<div class="field">
							<label for="txtMessage" class="hide">Message</label>
							<textarea name="text" id="txtMessage" cols="4" rows="3"></textarea>
						</div>
						<div class="submit-alt">
							<button type="submit" class="add-comment">Add Comment</button>
						</div>
					</form>
				{else}
					<p><a href="/user/loginbounce/username/{$user.username}/backto/commentarchive" title="Login">Login</a> to add a comment.</p>
				{/if} 
				{if count($comments) gt 0}
				<ol class="comments">
				{foreach from=$comments item=comment}
					<li id="comment-{$comment.comment_id}"><p>{$comment.text|escape} {if $loggedInUsername eq $user.username}
					 <a href="/user/deletecomment/id/{$comment.comment_id}" title="Delete this comment?">(delete)</a>
					{/if}	</p><p class="meta">- <cite><a href="/profile/{$comment.username}" title="{$comment.username}">{$comment.username}</a></cite> <em>{$comment.posted_on|date_format:$format_datetime_small}</em>		
					</p>
					</li>
				{/foreach}
				</ol>				
			{/if}
			</div>
		</div>
	</div>
	<div class="sub">
		{include file="file:$theme_global/_user_nav.tpl"}
	</div>	
</div>
{include file="file:$theme_global/_footer.tpl"}